<?php

/**
 * This is the model class for table "jumlahnikahdetail".
 *
 * The followings are the available columns in table 'jumlahnikahdetail':
 * @property integer $jnd_id
 * @property integer $jnd_kec
 * @property integer $jnd_jan_nikah
 * @property integer $jnd_jan_cerai
 * @property integer $jnd_feb_nikah
 * @property integer $jnd_feb_cerai
 * @property integer $jnd_mar_nikah
 * @property integer $jnd_mar_cerai
 * @property integer $jnd_apr_nikah
 * @property integer $jnd_apr_cerai
 * @property integer $jnd_mei_nikah
 * @property integer $jnd_mei_cerai
 * @property integer $jnd_ags_nikah
 * @property integer $jnd_ags_cerai
 * @property integer $jnd_sep_nikah
 * @property integer $jnd_sep_cerai
 * @property integer $jnd_okt_nikah
 * @property integer $jnd_okt_cerai
 * @property integer $jnd_nov_nikah
 * @property integer $jnd_nov_cerai
 * @property integer $jnd_des_nikah
 * @property integer $jnd_des_cerai
 * @property integer $jnd_tahun
 *
 * The followings are the available model relations:
 * @property Kecamatan $jndKec
 */
class Jumlahnikahdetail extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Jumlahnikahdetail the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'jumlahnikahdetail';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('jnd_kec, jnd_jan_nikah, jnd_jan_cerai, jnd_feb_nikah, jnd_feb_cerai, jnd_mar_nikah, jnd_mar_cerai, jnd_apr_nikah, jnd_apr_cerai, jnd_mei_nikah, jnd_mei_cerai, jnd_ags_nikah, jnd_ags_cerai, jnd_sep_nikah, jnd_sep_cerai, jnd_okt_nikah, jnd_okt_cerai, jnd_nov_nikah, jnd_nov_cerai, jnd_des_nikah, jnd_des_cerai, jnd_tahun', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('jnd_id, jnd_kec, jnd_jan_nikah, jnd_jan_cerai, jnd_feb_nikah, jnd_feb_cerai, jnd_mar_nikah, jnd_mar_cerai, jnd_apr_nikah, jnd_apr_cerai, jnd_mei_nikah, jnd_mei_cerai, jnd_ags_nikah, jnd_ags_cerai, jnd_sep_nikah, jnd_sep_cerai, jnd_okt_nikah, jnd_okt_cerai, jnd_nov_nikah, jnd_nov_cerai, jnd_des_nikah, jnd_des_cerai, jnd_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'jndKec' => array(self::BELONGS_TO, 'Kecamatan', 'jnd_kec'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'jnd_id' => 'Jnd',
			'jnd_kec' => 'Jnd Kec',
			'jnd_jan_nikah' => 'Jnd Jan Nikah',
			'jnd_jan_cerai' => 'Jnd Jan Cerai',
			'jnd_feb_nikah' => 'Jnd Feb Nikah',
			'jnd_feb_cerai' => 'Jnd Feb Cerai',
			'jnd_mar_nikah' => 'Jnd Mar Nikah',
			'jnd_mar_cerai' => 'Jnd Mar Cerai',
			'jnd_apr_nikah' => 'Jnd Apr Nikah',
			'jnd_apr_cerai' => 'Jnd Apr Cerai',
			'jnd_mei_nikah' => 'Jnd Mei Nikah',
			'jnd_mei_cerai' => 'Jnd Mei Cerai',
			'jnd_ags_nikah' => 'Jnd Ags Nikah',
			'jnd_ags_cerai' => 'Jnd Ags Cerai',
			'jnd_sep_nikah' => 'Jnd Sep Nikah',
			'jnd_sep_cerai' => 'Jnd Sep Cerai',
			'jnd_okt_nikah' => 'Jnd Okt Nikah',
			'jnd_okt_cerai' => 'Jnd Okt Cerai',
			'jnd_nov_nikah' => 'Jnd Nov Nikah',
			'jnd_nov_cerai' => 'Jnd Nov Cerai',
			'jnd_des_nikah' => 'Jnd Des Nikah',
			'jnd_des_cerai' => 'Jnd Des Cerai',
			'jnd_tahun' => 'Jnd Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('jnd_id',$this->jnd_id);
		$criteria->compare('jnd_kec',$this->jnd_kec);
		$criteria->compare('jnd_jan_nikah',$this->jnd_jan_nikah);
		$criteria->compare('jnd_jan_cerai',$this->jnd_jan_cerai);
		$criteria->compare('jnd_feb_nikah',$this->jnd_feb_nikah);
		$criteria->compare('jnd_feb_cerai',$this->jnd_feb_cerai);
		$criteria->compare('jnd_mar_nikah',$this->jnd_mar_nikah);
		$criteria->compare('jnd_mar_cerai',$this->jnd_mar_cerai);
		$criteria->compare('jnd_apr_nikah',$this->jnd_apr_nikah);
		$criteria->compare('jnd_apr_cerai',$this->jnd_apr_cerai);
		$criteria->compare('jnd_mei_nikah',$this->jnd_mei_nikah);
		$criteria->compare('jnd_mei_cerai',$this->jnd_mei_cerai);
		$criteria->compare('jnd_ags_nikah',$this->jnd_ags_nikah);
		$criteria->compare('jnd_ags_cerai',$this->jnd_ags_cerai);
		$criteria->compare('jnd_sep_nikah',$this->jnd_sep_nikah);
		$criteria->compare('jnd_sep_cerai',$this->jnd_sep_cerai);
		$criteria->compare('jnd_okt_nikah',$this->jnd_okt_nikah);
		$criteria->compare('jnd_okt_cerai',$this->jnd_okt_cerai);
		$criteria->compare('jnd_nov_nikah',$this->jnd_nov_nikah);
		$criteria->compare('jnd_nov_cerai',$this->jnd_nov_cerai);
		$criteria->compare('jnd_des_nikah',$this->jnd_des_nikah);
		$criteria->compare('jnd_des_cerai',$this->jnd_des_cerai);
		$criteria->compare('jnd_tahun',$this->jnd_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}